package com.yequan.thread.timer.base;

import java.util.Calendar;
import java.util.Date;
import java.util.Timer;

public class Run {

    public static void main(String[] args) {
        System.out.println("当前时间为:" + System.currentTimeMillis());
        Calendar instance = Calendar.getInstance();
        instance.add(Calendar.SECOND, 10);
        Date time = instance.getTime();
        MyTask myTask = new MyTask();
        Timer timer = new Timer();
        timer.schedule(myTask, time ,1000);
    }

}
